import Vue from 'vue'
import Router from 'vue-router'
import Demo from '@/pages/demo.vue'
import Index from '@/pages/index'
import HomeIndex from '@/pages/home/index'
import ArticleIndex from '@/pages/article/index'
import ArticleDetail from '@/pages/article/detail'
import LabelIndex from '@/pages/label/index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/',
          name: 'HomeIndex',
          component: HomeIndex
        },
        {
          path: 'article',
          name: 'ArticleIndex',
          component: ArticleIndex,
          children: [
            {
              path: '/article/:id',
              name: 'ArticleDetail',
              component: ArticleDetail
            }
          ]
        },
        {
          path: 'label',
          name: 'LabelIndex',
          component: LabelIndex
        }
      ]
    },
  ]
})
